/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package skelbkim;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

/**
 *
 * @author laimis
 */
public class Septyni_24 extends SeleneseTestCase {

    public void setUp() throws Exception {
        setUp("http://www.7-24.lt/", "*firefox");
    }

    public void newNotation(String noticeText, String phone, String name, String noticeTitle, String email) throws Exception {
        selenium.open("/naujas.php");
        if (isPageLoude()) {
            selenium.click("//a/font/b");
            selenium.waitForPageToLoad("10000");
            selenium.type("tekstas", "asdasdasd");
            selenium.type("vardas", "admin");
            selenium.type("miestas", "klaipde");
            selenium.type("kaina", "700");
            selenium.type("tel", "54645645");
            selenium.type("email", "laimis.milasius@gmail.com");
            selenium.type("skype", "TESTAS");
            selenium.select("EndDate", "label=1 dieną");
            selenium.click("/html/body/table/tbody/tr[8]/td/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td[2]/input[6]");
        }
        selenium.stop();

    }

    private boolean isPageLoude() {
        boolean result = true;
        while (!selenium.isElementPresent("//table/tbody/tr[8]/td/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td[2]/input[6]")) {
            selenium.waitForPageToLoad("5000");
        }
        return result;
    }
}

